package com.adam.example.types;

import com.adam.example.search.converter.StringToGeoPointConverter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.elasticsearch.geometry.Point;

@JsonIgnoreProperties(ignoreUnknown = true)
public class GeoCity {

    private String name;
    @JsonDeserialize(converter = StringToGeoPointConverter.class)
    private Point location;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Point getLocation() {
        return location;
    }

    public void setLocation(Point location) {
        this.location = location;
    }

    @Override
    public String toString() {
        return "GeoCity{" +
                "name='" + name + '\'' +
                ", location=" + location +
                '}';
    }
}
